<?php $type = \Yii::$app->request->get('type', 5); ?>
<div class="ucenterRight" style="overflow-y: auto;height: 830px">
    <div class="recordCover">
        <div class="recordNav">
            <a href="/mock/record.html?type=5" <?php echo $type == 5 ? 'class="on"' : '' ?>>全套模考</a>
            <a href="/mock/record.html?type=1" <?php echo $type == 1 ? 'class="on"' : '' ?>>听力单项</a>
            <a href="/mock/record.html?type=2" <?php echo $type == 2 ? 'class="on"' : '' ?>>阅读单项</a>
        </div>
        <?php foreach ($data as $k => $v) {
            if ($type == 5) {
                ?>
                <div class="recordItem">
                    <p class="recordTitle"><?php echo $v['name'] ?>
                        <span>模考时间：<?php echo date('Y.m.d H:i', $v['endTime']) ?></span></p>

                    <div class="recordSta">
                        <div class="recordStaTotal">
                            <p>
                                <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/mock/13@2x.png" alt="">
                                总耗时
                            </p>
                            <span><?php echo $v['mockTime'] ?></span>
                        </div>
                        <div class="recordStaItem">
                            <div>
                                <p>听力</p>
                                <span><?php echo $v['doListenCount'] ?>/<?php echo $v['listenCount'] ?></span>
                            </div>
                            <p></p>

                            <div>
                                <p>阅读</p>
                                <span><?php echo $v['doReadCount'] ?>/<?php echo $v['readCount'] ?></span>
                            </div>
                            <p></p>

                            <div>
                                <p>写作</p>
                                <span><?php echo $v['doWriteCount'] ?>/<?php echo $v['writeCount'] ?></span>
                            </div>
                        </div>
                        <?php if ($v['continue'] == 0 && $v['isOver'] == 1) {//完成 ?>
                            <!--已完成-->
                            <p class="successStatus">已完成</p>
                            <div class="linkBox">
                                <a href="javascript:;" onclick="showPop(<?php echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>
                                <a href="/mock/result.html?type=<?php echo $type ?>&cate=<?php echo $v['mockcate_id'] ?>"
                                   class="result">查看结果</a>
                            </div>
                        <?php } ?>
                        <?php if (($v['continue'] == 2 && $v['isOver'] == 1) || ($v['continue'] == 1 && $v['isOver'] == 0)) {//未完成 ?>

                            <!--未完成-->
                            <p class="testStatus">未完成</p>
                            <div class="linkBox">
                                <a href="javascript:;" onclick="showPop(<?php echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>
                                <a href="/mock/result.html?type=<?php echo $type ?>&cate=<?php echo $v['mockcate_id'] ?>"
                                   class="result">查看结果</a>
                            </div>
                        <?php } ?>
<!--                        --><?php //if ($v['continue'] == 1 && $v['isOver'] == 0) { //中断?>
<!--                            <!--中断-->
<!--                            <p class="continueStatus">已中断--><?php //echo $v['time'] ?><!--</p>-->
<!--                            <div class="linkBox">-->
<!--                                <a href="/cn/mock/--><?php //echo $v['startType'] ?><!--&type=5&cate=--><?php //echo $v['mockcate_id'] ?><!--&contuniu=1"-->
<!--                                   class="start">继续模考</a>-->
                        <!--<a href="javascript:;" onclick="showPop(<?php // echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>-->
<!--                            </div>-->
                        <?php //} ?>
                    </div>
                </div>
            <?php } else {
                ?>
                <!--循环 recordItem  这个是听力和阅读通用-->
                <div class="recordItem">
                    <p class="recordTitle"><?php echo $v['name'] ?>
                        <span>模考时间：<?php echo date('Y.m.d H:i', $v['endTime']) ?></span></p>

                    <div class="recordSta">
                        <div class="recordStaTotal" style="width: 271px">
                            <p>
                                <img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/mock/13@2x.png" alt="">
                                总耗时
                            </p>
                            <span><?php echo $v['mockTime'] ?></span>
                        </div>
                        <div class="recordStaItem" style="width: 271px">
                            <div>
                                <p><img src="https://file.viplgw.cn/ui/thinku-ielts-new/images/mock/14@2x.png" alt="">做题数</p>
                                <span><?php echo $type == 1 ? $v['doListenCount'] : $v['doReadCount'] ?>/40</span>
                            </div>
                        </div>
                        <?php if ($v['continue'] == 0 && $v['isOver'] == 1) {//完成 ?>
                            <!--已完成-->
                            <p class="successStatus">已完成</p>
                            <div class="linkBox">
                                <a href="javascript:;"
                                   onclick="showPop(<?php echo $type ?>,<?php echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>
                                <a href="/mock/result.html?type=<?php echo $type ?>&cate=<?php echo $v['mockcate_id'] ?>"
                                   class="result">查看结果</a>
                            </div>
                        <?php } ?>
                        <?php if ($v['continue'] == 2 && $v['isOver'] == 1) {//未完成 ?>

                            <!--未完成-->
                            <p class="testStatus">未完成</p>
                            <div class="linkBox">
                                <a href="javascript:;"
                                   onclick="showPop(<?php echo $type ?>,<?php echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>
                                <a href="/mock/result.html?type=<?php echo $type ?>&cate=<?php echo $v['mockcate_id'] ?>"
                                   class="result">查看结果</a>
                            </div>
                        <?php } ?>
                        <?php if ($v['continue'] == 1 && $v['isOver'] == 0) { //中断?>
                            <!--中断-->
                            <p class="continueStatus">已中断<?php echo $v['time'] ?></p>
                            <div class="linkBox">
                                <a href="/cn/mock/<?php echo $v['startType'] ?>&type=<?php echo $type ?>&cate=<?php echo $v['mockcate_id'] ?>&contuniu=1"
                                   class="start">继续模考</a>
                                <a href="javascript:;"
                                   onclick="showPop(<?php echo $type ?>,<?php echo $v['mockcate_id'] ?>)" class="reset">重新模考</a>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            <?php }
        } ?>
    </div>
    <div class="tipsPop">
        <div class="tipsCenter">
            <div class="image-text_1 flex-col justify-between">
                <img class="image_1" src="https://file.viplgw.cn/ui/thinku-ielts-new/images/mock/17@2x.png"/>
                <div class="text-group_1 flex-col justify-between">
                    <p class="text_1">提示</p>
                    <span class="text_2">重新模考将覆盖现有做题结果！是否继续？</span>
                </div>
            </div>
            <div class="group_2">
                <a href="" class="group_2Left">确定</a>
                <a href="javascript:;" onclick="closeData()" class="group_2Right">取消</a>
            </div>
        </div>
    </div>
</div>
<script>
    function showPop(type, id) {
        $('.tipsPop').show()
        $('.group_2Left').attr('href', '/mock/guide.html?type=' + type + '&cate=' + id)
    }
    function closeData() {
        $('.tipsPop').hide()
    }
</script>
